# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         test03
# Description:
# Author:       98745
# Date:         2019/3/23
#-------------------------------------------------------------------------------
try:
    class Person:
        def __init__(self,name,age,sex):
            print('init')
            self.name = name
            self.age = age
            self.sex = sex

        def eat(self):
            print('吃东西')

    class Student(Person):
        def __init__(self,name,age,sex,collage):
            super().__init__(name,age,sex)
            self.collage = collage

        def eat(self,apple):
            super().eat()
            print(apple)

    if __name__ == '__main__':
        p = Person('Young',20,'男')
        print(p)
        print(p.name)
        p.eat()

        print('--------------')
        s = Student('Young',20,'男','HUT')
        s.eat('芒果')
except Exception as e:
    print(e)